change GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
authorHavoc Pennington <hp@redhat.com>
Fri, 18 Jan 2002 00:45:50 +0000 (00:45 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Fri, 18 Jan 2002 00:45:50 +0000 (00:45 +0000)
2002-01-17  Havoc Pennington  <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
as in the keynav spec, though it makes the interpretation of
GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
any sense anyhow.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktextview.c

index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 5182431543f46a0fa796a96fef387ab04a182ade..0cda76c973a988fb95e70c20072f55f8090fc55e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-17  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change
+       GTK_MOVEMENT_PARAGRAPHS to go to start/end of paragraph before it
+       starts to go up/down paragraphs. This makes Ctrl+Up/Ctrl+Down work
+       as in the keynav spec, though it makes the interpretation of
+       GTK_MOVEMENT_PARAGRAPHS different from the interpretation of some
+       of the other GTK_MOVEMENT_ thingies, maybe, as if that enum makes
+       any sense anyhow.
+
 Thu Jan 17 16:34:55 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): For
index 7f3f79e3b179460828b3cbcd008c7407b848678f..10cb65d1e5194114d29d62272d753ef793f66ee8 100644 (file)
@@ -4457,8 +4457,28 @@ gtk_text_view_move_cursor_internal (GtkTextView     *text_view,
       break;
 
     case GTK_MOVEMENT_PARAGRAPHS:
-      gtk_text_iter_forward_lines (&newplace, count);
-      gtk_text_iter_set_line_offset (&newplace, 0);
+      if (count > 0)
+        {
+          if (!gtk_text_iter_ends_line (&newplace))
+            {
+              gtk_text_iter_forward_to_line_end (&newplace);
+              --count;
+            }
+        }
+      else if (count < 0)
+        {
+          if (gtk_text_iter_get_line_offset (&newplace) > 0)
+            {
+              gtk_text_iter_set_line_offset (&newplace, 0);
+              ++count;
+            }
+        }
+
+      if (count != 0)
+        {
+          gtk_text_iter_forward_lines (&newplace, count);
+          gtk_text_iter_set_line_offset (&newplace, 0);
+        }
       break;
 
     case GTK_MOVEMENT_PARAGRAPH_ENDS: